<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="<%=basePath %>/resource/js/common-css-js.js"></script>
<title>采购计划-查询产品</title>
</head>
<style>
	body {
		padding: 0 15px;
	}
</style>
<body>
	<table id="productTable" lay-filter="test"></table>
	<script type="text/javascript">
		table.render({
		    elem: '#productTable'
		    ,height: 315
		    ,cellMinWidth: 80
	  		,page: true
	  		,limits: [10,50,100]
		    ,cols: [[
		    	{field:'supplierName',title:'供应商',align: 'center'},
		    	{field:'prodName',title:'品名',align: 'center'},
		    	{field:'prodModel',title:'型号',align: 'center'},
		    	{field:'prodSpecifications',title:'规格',align: 'center'},
		    	{field:'prodSize',title:'尺寸',align: 'center'},
		    	{field:'prodWeight',title:'重量',align: 'center'},
		    	{field:'prodMaterials',title:'用料',align: 'center'},
		    	{field:'prodType',title:'种类',align: 'center'},
		    	{field:'prodUnit',title:'单位',align: 'center'},
		    	{field:'prodImportFlag',title:'是否进口',align: 'center'},
		    	{field:'prodPrice',title:'价格',align: 'center'}
		    ]]
		  	,text: {
			   none: '暂无相关数据'
			}
	    });
		
		$(function(){
			var selectedObj = parent.cTable.bootstrapTable('getSelections');
			$.get(
				path+"/procurement/procurement-plan/"+selectedObj[0].procurePlanId,
				function(data){
	          		//渲染表格
			    	table.reload('productTable', {
						url: path+'/procurement/production-prise/prodId='+data.prodId,
					  	response: {
					  	  statusName: 'code' 	//数据状态的字段名称，默认：code
					  	  ,statusCode: 200 		//成功的状态码，默认：0
					  	  ,msgName: 'msg' 		//状态信息的字段名称，默认：msg
					  	  ,countName: 'count'   //数据总数的字段名称，默认：count
					  	  ,dataName: 'data' 	//数据列表的字段名称，默认：data
					  	}
					});
		        }
			);
		})
	</script>
</body>
</html>